
fun main(args: Array<String>) {

    print("sum of 3 and 5 is ")
    println(sum(3, 5))

    println("sum of 19 and 23 is ${sum(19, 23)}")

    printSum(-1, 8)
}

//带有两个Int 参数、返回Int的函数
//fun sum(a: Int, b: Int): Int {
//    return a + b
//}
//将表达式作为函数体、返回值自动推断的函数：
fun sum(a: Int, b: Int) = a + b

////函数返回无意义的值
//fun printSum(a: Int, b: Int): Unit {
//    println("com.tomas.kotlin.`01-基础语法`.sum is $a and $b is ${a + b}")
//}

//Unit返回类型可以省略
fun printSum(a: Int, b: Int) {
    println("sum of $a and $b is ${a + b}")
}





